<?php
namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;

class DefaultController extends Controller
{

    public function successView($message,$url='/', $title='操作成功', $second=3){
        return view('admin.result', ['message'=>$message, 'title'=>$title, 'second'=>$second, 'type'=>1, 'url'=> $url]);
    }

    public function failView($message, $url='', $title='操作失败', $second=5){
        if(empty($url)){
            $url = url()->previous();
        }
        return view('admin.result', ['message'=>$message, 'title'=>$title, 'second'=>$second, 'type'=>0, 'url'=> $url]);
    }
}